$(document).ready(function () {
    $(".result-score-button").click(function() {
       self.location = "/home/";
    });
    $.get("http://127.0.0.1:8000/get_partial_label/", function(data) {
        var partial_label_list = data.split('##');
        for (var i = 0; i < partial_label_list.length; i++) {
            var partial_label = partial_label_list[i].split('#');
            j = i + 1;
            //alert(partial_label[0] + ' ' + partial_label[1] + ' ' + partial_label[2] + ' ' + partial_label[3]);
            if (!(partial_label[0] == 0 && partial_label[1] == 0 && partial_label[2] == 0 && partial_label[3] == 0 || partial_label[0] == partial_label[2] || partial_label[1] == partial_label[3])) {
                $('div.result-every-pic:nth-child(' + j + ') img').imgAreaSelect({ x1: partial_label[0], y1: partial_label[1], x2: partial_label[2], y2: partial_label[3] });
            }
        }
    });
});
